home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / game / patch / WHDIDemos.lzh / Bass_NoTech.lha / NoTechHD / Install-NoTech next >
Text File  |  2001-12-26  |  5KB  |  230 lines

  1. ;****************************
  2.  
  3. (set #readme-file "ReadMe")        ;name of the readme file
  4. (set #highs-file "highs")        ;name of high scores file
  5.  
  6. (procedure P_MakeImages
  7.  
  8.   ;the following lines must be copied and adjusted for multiple disk images
  9.  
  10.   (set #CI_disknum 1)
  11.   (set #CI_diskname ("%s Disk %ld" @app-name #CI_disknum))
  12.   (set #CI_disklen $85E00)
  13.   (set #CI_skiptrk -1)
  14.   (P_CreateImage)
  15.  
  16. )
  17.  
  18. ;****************************
  19. ;----------------------------
  20. ; checks if given program is installed, if not abort install
  21. ; #program - to check
  22.  
  23. (procedure P_ChkRun
  24.   (if
  25.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  26.     ("")
  27.     (abort 
  28.       (cat
  29.     "You must install \"" #program "\" first!\n"
  30.     "It must be accessible via the path.\n"
  31.     "You can find it in the WHDLoad package."
  32.       )
  33.     )
  34.   )
  35. )
  36.  
  37. ;----------------------------
  38. ; Create Image using DIC
  39. ; #dest        - path to save image in
  40. ; #CI_disknum  - number of the disk image to create
  41. ; #CI_diskname - label of the disk
  42. ; #CI_disklen  - length of disk image to create
  43. ; #CI_skiptrk  - track to skip, -1 means no skip
  44. ; #CI_drive    - drive to create image from
  45.  
  46. (procedure P_CreateImage
  47.   (message
  48.     (cat
  49.     "\nInsert \"" #CI_diskname "\" into drive " #CI_drive "!\n\n"
  50.     "(make sure it's the right disk because it will not be checked)"
  51.     )
  52.   )
  53.   (if
  54.     (>= #CI_skiptrk 0)
  55.     (set #option (cat " SKIPTRACK=" #CI_skiptrk))
  56.     (set #option "")
  57.   )
  58.   (if
  59.     (= 0
  60.       (run 
  61.         (cat
  62.           "cd \"" #dest "\"\n"
  63.           "DIC " #CI_drive " FD=" #CI_disknum " LD=" #CI_disknum " SIZE="
  64.           #CI_disklen #option " PEDANTIC >CON:///1000//CLOSE"
  65.         )
  66.       )
  67.     )
  68.     (run ("FileNote \"%s.%ld\" \"%s\" Quiet" (tackon #dest "disk") #CI_disknum @app-name))
  69.     (abort "\"DIC\" has failed to create a diskimage")
  70.   )
  71. )
  72.  
  73. ;****************************
  74.  
  75. (if
  76.   (exists #readme-file)
  77.   (if
  78.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  79.     ("")
  80.     (run ("SYS:Utilities/More %s" #readme-file))
  81.   )
  82. )
  83.  
  84. (set #program "WHDLoad")
  85. (P_ChkRun)
  86.  
  87. (set #program "DIC")
  88. (P_ChkRun)
  89.  
  90. ; in expert mode ask for source drive
  91. (if
  92.   (= @user-level 2)
  93.   (
  94.     (set #CI_drive
  95.       (askchoice
  96.     (prompt "Select source drive for diskimages")
  97.     (default 0)
  98.     (choices "DF0:" "DF1:" "RAD:" "Enter Device")
  99.     (help @askchoice-help)
  100.       )
  101.     )
  102.     (select #CI_drive
  103.       (set #CI_drive "DF0:")
  104.       (set #CI_drive "DF1:")
  105.       (set #CI_drive "RAD:")
  106.       (set #CI_drive
  107.         (askstring
  108.           (prompt "Select source drive for diskimages")
  109.           (default "DF0:")
  110.           (help @askstring-help)
  111.         )
  112.       )
  113.     )
  114.   )
  115.   (set #CI_drive "DF0:")
  116. )
  117.  
  118. (if
  119.   (getenv "WHDLInstPath")
  120.   (set @default-dest (getenv "WHDLInstPath"))
  121. )
  122. (set @default-dest
  123.   (askdir
  124.     (prompt 
  125.       (cat
  126.     "Where should \"" @app-name "\" be installed?\n"
  127.     "A drawer \"" @app-name "\" will be automatically created."
  128.       )
  129.     )
  130.     (help @askdir-help)
  131.     (default @default-dest)
  132.     (disk)
  133.   )
  134. )
  135. (run ("setenv WHDLInstPath \"%s\"" @default-dest))
  136. (set #dest (tackon @default-dest @app-name))
  137. (if
  138.   (exists #dest)
  139.   (
  140.     (set #choice
  141.       (askbool
  142.         (prompt
  143.           (cat
  144.             "\nDirectory \"" #dest "\" already exists.\n"
  145.             "Should it be deleted?"
  146.           )
  147.         )
  148.         (default 1)
  149.         (choices "Delete" "Skip")
  150.         (help @askbool-help)
  151.       )
  152.     )
  153.     (if
  154.       (= #choice 1)
  155.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  156.     )
  157.   )
  158. )
  159. (makedir #dest
  160.   (help @makedir-help)
  161.   (infos)
  162. )
  163.  
  164. ;----------------------------
  165.  
  166. (copyfiles
  167.   (help @copyfiles-help)
  168.   (source ("%s.Slave" @app-name))
  169.   (dest #dest)
  170. )
  171. (if
  172.   (exists ("%s.newicon" @app-name))
  173.   (set #icon
  174.     (askchoice
  175.       (prompt "\nWhich icon would you like to install?\n")
  176.       (default 0)
  177.       (choices "ColorIcon" "NewIcon")
  178.       (help @askchoice-help)
  179.     )
  180.   )
  181.   (set #icon 0)
  182. )
  183. (select #icon
  184.   (set #icon ("%s.coloricon" @app-name))
  185.   (set #icon ("%s.newicon" @app-name))
  186. )
  187. (copyfiles
  188.   (help @copyfiles-help)
  189.   (source #icon)
  190.   (newname ("%s.info" @app-name))
  191.   (dest #dest)
  192. )
  193. (if
  194.   (exists #readme-file)
  195.   (copyfiles
  196.     (help @copyfiles-help)
  197.     (source #readme-file)
  198.     (dest #dest)
  199.   )
  200. )
  201. (if
  202.   (exists ("%s.info" #readme-file))
  203.   (
  204.     (copyfiles
  205.       (help @copyfiles-help)
  206.       (source ("%s.info" #readme-file))
  207.       (dest #dest)
  208.     )
  209.     (tooltype
  210.       (dest (tackon #dest #readme-file))
  211.       (noposition)
  212.     )
  213.   )
  214. )
  215. (if
  216.   (exists #highs-file)
  217.   (copyfiles
  218.     (help @copyfiles-help)
  219.     (source #highs-file)
  220.     (dest #dest)
  221.   )
  222. )
  223.  
  224. (P_MakeImages)
  225.  
  226. ;----------------------------
  227.  
  228. (exit)
  229.  
  230.